window.Event = new Vue();

Vue.component('task',{
    template:'<div @click="onClick"><span><slot></slot></span></div>',
    methods:{
        onClick(){
            console.log('click!');
            // this.$emit('notify');
            Event.$emit('handle')
        }
    }
}) 

var app = new Vue({
    el:'#app',
    methods:{
        onNotify(){
            "use strict";
            console.log('notify');
        }
    },
    created(){
        "use strict";
        Event.$on('handle',()=>alert('handing!'))
    }
})







